#include "xmlWidget.h"
using namespace xmlWidgetLib;

#include <iostream>
#include <string>
using namespace std;

#include "xmlWidgetEventHandler.h"
#include "logManager.h"
/*
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
*******************************************************************************************
*/

void xmlWidget::parseXmlFileSelection(void) throw( string * )
{
	logger << __FUNCTION__ << " Start" << endl;

	const char *title = m_XmlRoot->Attribute("title");
	if( title )
	{
		m_Widget = gtk_file_selection_new( title );
	}
	if( NULL == m_Widget )
	{
		throw new string("Error: can not new file selection");
	}

	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (m_Widget)->ok_button),
		      "clicked", GTK_SIGNAL_FUNC (FileSelectionOK_CallBack), (gpointer) this );	
	gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (m_Widget)->cancel_button),
		      "clicked", GTK_SIGNAL_FUNC (FileSelectionCancel_CallBack), (gpointer) this );
   
	g_signal_connect(G_OBJECT(m_Widget), "destroy", G_CALLBACK(FileSelectionDestroy_CallBack),(gpointer) this );

	logger << __FUNCTION__ << " Success" << endl;
}
